﻿<%@ Page Language="C#" AutoEventWireup="true" CodeBehind="Index.aspx.cs" Inherits="YXQ.Manager.Manager.Index" %>

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head id="Head1" runat="server">
    <title>重庆市双福建设开发有限公司工程项目管理信息系统</title>
    <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
    <link rel="stylesheet" type="text/css" href="../themes/default/easyui.css" />
    <link rel="stylesheet" type="text/css" href="../css/default.css" />
    <link rel="stylesheet" type="text/css" href="../themes/style.css" />
    <script type="text/javascript" src="../script/jquery.js?v=1"></script>
    <script type="text/javascript" src="../script/jquery.json-2.2.min.js"></script>
    <script type="text/javascript" src="../script/jquery.easyui.min.1.2.2.js"></script>
    <script src="../Script/jQuery.blockUI.js" type="text/javascript"></script>
    <script src="../Script/jquery.SuperSlide.js" type="text/javascript"></script>
    <script type="text/javascript" src="../script/outlook2.js"></script>
    <script type="text/javascript" src="../script/Core.js"></script>
    <script type="text/javascript" src="../script/Main.js"></script>
     <script src="../Script/My97DatePicker/WdatePicker.js" type="text/javascript"></script>

</head>
<script type="text/javascript">
    var _menus = {"menus":<%=strMenu%>};
     
</script>
<body class="easyui-layout">
    <div class="head" region="north" split="true" border="false">
        <h1>双福工程项目管理系统</h1>
        <div class="user">
            <span>你好：<asp:Literal ID="ltrName" runat="server"></asp:Literal></span>
            <span><a href="javascript:;" onclick="addTab('修改密码','ModifyPassWord.aspx');" id="editpass">修改密码</a></span> <span><a href="loginout.aspx" id="loginOut">退出</a></span>
        </div>
    </div>
    <div region="west" split="true" title="工程管理信息系统" style="width: 180px">
        <div id="nav" class="easyui-accordion" fit="true" border="false">
        </div>
    </div>

    <script type="text/javascript">
        $(function () {
            $('#dg').datagrid({
                title: '最近所有工程',
                iconCls: 'icon icon-nav',
                height: 300,
                nowrap: true,
                autoRowHeight: false,
                animate:false,
                striped: true,
                url:"../Handler/DataHandler.ashx?OpType=GetTop&tpNum=10",
                sortOrder: 'desc',
                remoteSort: false,
                pagination: true,
                pageSize: 10,
                pageList: [10, 20, 30],
                toolbar: '#tb',
                onDblClickRow:ShowRow,
                columns: [[
                        { field: 'Id', title: 'ID', width: 20 },
                        { field: 'ProjectName', title: '项目名称', width: 200 },
                        { field: 'CompName', title: '施工单位', width: 200 },
                        { field: 'HtPrice', title: '合同金额', width: 60 },
                        { field: 'SJrice', title: '审计金额', width: 60 },
                        { field: 'Pay', title: '工程款已付', width: 80 },
                        { field: 'BackPay', title: '工程款已退保证金', width: 100 },
                         { field: 'StartTime', title: '开工时间', width: 70,formatter:Formatterdate },
                        { field: 'EndTime', title: '完工时间', width: 70 ,formatter:Formatterdate },
                         <%
        if (AdminUser != null)
        {
            if (AdminUser.UserName == "admin")
            {%>
                        { field: 'CreateRealName', title: '创建者', width: 100 },
                       // { field: 'CreateTime', title: '创建时间', width: 120 ,formatter:Formatterdate},
                          { field: 'UpdateRealName', title: '修改者', width: 100 },
                         //   { field: 'UpdateTime', title: '修改时间', width: 150 ,formatter:Formatterdate},
                          <%
            }
        }
        %>
                        { field: 'Tpid', title: 'tpid', hidden:true},
                        { field: 'opt', title: '操作', width: 150, align: 'center', 
                            formatter: function (value, rec) { 
                                return "<%
        if (AdminUser != null)
        {
            if (!string.IsNullOrEmpty(AdminUser.Depart))
            {%><a href='javascript:' id='edit'  onclick='Edit(" + rec.Id +","+rec.Tpid+ ")'>编辑</a>&nbsp;&nbsp;<%}
        }%><a href='javascript:'  onclick=block(" + rec.Id + ",'" + rec.ProjectName + "'," + rec.Tpid + ")>详情</a>&nbsp;&nbsp;<%
        if (AdminUser != null)
        {
            if (AdminUser.UserName == "admin")
            {%><a href='javascript:' onclick='Del(" + rec.Id + ")'>删除</a><%}
        }%>&nbsp;&nbsp;<a href='javascript:' onclick=ShowProject(" + rec.Id + "," + rec.Tpid + ",'" + rec.ProjectName + "') >查看明细</a>";
                            }
                        }
                ]]
             


            });

        });
        function ShowRow(rowindex,rowdata){ 
            YXQ.Manager.OpenDialog('openwin',"ProjectShow.aspx?id=" + rowdata.Id + "&tpid="+rowdata.Tpid+"", rowdata.ProjectName+"项目详细进度", ($(window).width() - 300),  ($(window).height() -100)); 
        }

                    function ShowProject(val, tpi,ttl) {
                        YXQ.Manager.OpenDialog('openwin',"ProjectShow.aspx?id=" + val + "&tpid="+tpi+"", ttl+"项目详细进度", ($(window).width() - 300),  ($(window).height() -100)); 
                    }
                    function Edit(val,tpid){
                        YXQ.Manager.OpenDialog('openwin',"Project.aspx?id=" + val+"&tpid="+tpid, "修改项目",600,200);
                    }

                    function Del(val){
                        YXQCore.Form.PostData("../Handler/CommonHandler.ashx",
                                            {OpType:"Del",PostData:val},
                                            function (data) {
                              
                                                if (data.ResultMessage == "Success") {
                                                    YXQ.Common.Message("恭喜你操作已经成功");
                                                    $("#dg").datagrid("reload");
                                                    return ;
                                                }
            
                                            });
                    }

                    function   Formatterdate (val, row) {
                        if (val == ""||val==null) {
                            return "";
                        }
                        var dt= val.replace("T", " "); 
                        
                        var rtnDate = new Date(Date.parse(dt.replace(/-/g, "/")));
                        
                        return rtnDate.getFullYear() + "-" + (rtnDate.getMonth() + 1) + "-" + rtnDate.getDate(); 
                    }
                    function block(cid,pName,tpid) {  
                        var url="ProjectDetail.aspx?id=" + cid+"&tpid="+tpid+"&day="+new Date();
                        YXQ.Manager.OpenDialog('openwin',url,pName,($(window).width()-200), ($(window).height()-100)); 
                    }

                    
                    $(function () {
                        //var demo = $("#showDemoBox");
                        //demo.find("em").click(function () { unblock(); });
                       
                        $("#openwin").dialog({
                            width: 658,    
                            height: 480,   
                            cache: false
                        });
                    });

                    function ShowMsg(val){
                        YXQ.Manager.OpenDialog('openwin',"MessageShow.aspx?id=" + val, "查看信息", 600, 300);
                    }
                    function GridSearch() {
                        $('#dg').datagrid('load', {
                            pname: $('#txtPName').val(),
                            compName: $('#compaName').val(),
                            startTime:$("#txtStart").val(),
                            sendTime:$("#sendTime").val(),
                            endTime:$("#txtEnd").val(),
                            estartTime:$("#estartTime").val()
          
                        });
                    }

    </script>

    <div region="center" id="Main">
        <div id="tabs" class="easyui-tabs" fit="true" border="false">
            <div class="content" title="系统默认">

                <div id="pp" style="position: relative">
                    <table cellspacing="0" cellpadding="0" width="100%" class="admintable">
                        <tr>
                            <td>
                                <table cellspacing="0" cellpadding="0" class="admintable01">
                                    <tr>
                                        <td>
                                            <marquee onmouseover="this.stop()" onmouseout="this.start()" scrollamount="5">  <%=AdminUser==null?"":AdminUser.RealName %> 您好;欢迎你回来。您一共登录系统<%=AdminUser==null?"": AdminUser.LoginCount.ToString() %>次，您上次登录系统的时间是：<%=AdminUser == null ? "" : AdminUser.LastLoginTime==null?"":AdminUser.LastLoginTime.Value.ToString("yyyy-MM-dd") %></marquee>
                                        </td>


                                    </tr>
                                </table>
                            </td>
                        </tr>
                    </table>
                    <div class="tbbutton">
                        <ul>
                            <li>
                                <img src="../images/but_2.gif" /><span><a onclick="addTab('房建及房建附属工程','ProjectList.aspx?tpid=2','icon icon-nav')" href="javascript:">房建工程</a></span></li>
                            <li>
                                <img src="../images/but_2.gif" /><span><a onclick="addTab('道路桥梁工程','ProjectList.aspx?tpid=3','icon icon-nav')" href="javascript:">路桥工程</a></span></li>
                            <li>
                                <img src="../images/but_2.gif" /><span><a onclick="addTab('雨污管网工程','ProjectList.aspx?tpid=4','icon icon-nav')" href="javascript:">雨污管网</a></span></li>
                            <li>
                                <img src="../images/but_2.gif" /><span><a onclick="addTab('平场护坡工程','ProjectList.aspx?tpid=5','icon icon-nav')" href="javascript:">平场护坡</a></span></li>
                            <li>
                                <img src="../images/but_2.gif" /><span><a onclick="addTab('环境绿化工程','ProjectList.aspx?tpid=6','icon icon-nav')" href="javascript:">环境绿化</a></span></li>
                            <li>
                                <img src="../images/but_2.gif" /><span><a onclick="addTab('水电气工程','ProjectList.aspx?tpid=7','icon icon-nav')" href="javascript:">水电气</a></span></li>
                            <li>
                                <img src="../images/but_2.gif" /><span><a onclick="addTab('装饰修缮工程','ProjectList.aspx?tpid=8','icon icon-nav')" href="javascript:">装饰修缮</a></span></li>
                            <li>
                                <img src="../images/but_2.gif" /><span><a onclick="addTab('零星工程','ProjectList.aspx?tpid=9','icon icon-nav')" href="javascript:">零星工程</a></span></li>
                        </ul>
                    </div>
                    <br />


                    <fieldset>
                        <legend>最新信息</legend>
                        <div class="topLoop">
                            <div class="bd">
                                <ul class="infoList">
                                    <asp:Repeater ID="repQu" runat="server">
                                        <ItemTemplate>
                                            <li><%#Eval("createusername") %>说：<a href="javascript:" onclick="ShowMsg('<%#Eval("id") %>')" title="<%#Eval("qcontent") %>"><%#Eval("qname") %></a>内容：<a href="javascript:" onclick="ShowMsg('<%#Eval("id") %>')"> <%#YXQ.Common.Helper.StringUtils.getLimitLengthString( Eval("qcontent").ToString(),80,"...") %></a></li>

                                        </ItemTemplate>
                                    </asp:Repeater>
                                </ul>
                            </div>
                        </div>
                    </fieldset>
                    <script type="text/javascript">jQuery(".topLoop").slide({ mainCell:".bd ul",effect:"topMarquee",vis:6,interTime:80,autoPlay:true});</script>

                    <table id="dg">
                    </table>
                      <div id="tb" style="height: auto">
                         <table  >
                        <tr>
                            <td class="tdtitle" align="left">项目名称：
                            </td>
                            <td align="left" class="tdtitle">
                                <input type="text" id="txtPName" />
                            </td>
                            <td align="left" class="tdtitle">施工单位：
                            </td>
                            <td align="left" class="tdtitle">
                                <input type="text" id="compaName"  />
                            </td> 
                            <td align="left" class="tdtitle">开工时间：
                            </td>
                            <td align="left" class="tdtitle">
                                <input type="text" id="txtStart" onfocus="WdatePicker({dateFmt:'yyyy-MM-dd'})"  style="width:80px;"/>-<input type="text" id="sendtime" onfocus="WdatePicker({dateFmt:'yyyy-MM-dd'})"   style="width:80px;"/>
                            </td> 
                            <td align="left" class="tdtitle">完工时间：
                            </td>
                            <td align="left" class="tdtitle">
                              <input type="text" id="estartTime" onfocus="WdatePicker({dateFmt:'yyyy-MM-dd'})"  style="width:80px;"/>-<input type="text" id="txtEnd"  onfocus="WdatePicker({dateFmt:'yyyy-MM-dd'})"   style="width:80px;"/> 
                            </td> 
                            <td align="left" class="tdtitle">
                                <input type="button" id="btnSearch" value="搜索" class="bt_wb1" onclick="GridSearch();" />
                            </td>
                        </tr>
                    </table>
                    </div>

                </div>
            </div>
        </div>
    </div>
    <div id="openwin" class="easyui-dialog" closed="true" data-options="iconCls:'icon-save',resizable:true,modal:true">
    </div>
    <div region="south" split="true" style="height: 30px; background: #D2E0F2;">
        <div class="footer" style="text-align: center">
            Copyright ©2011-2013  重庆奇想信息技术有限公司  Tel:63740383
        </div>
    </div>
    <div id="mm" class="easyui-menu" style="width: 150px;">
        <div id="mm-tabclose">
            关闭
        </div>
        <div id="mm-tabcloseall">
            全部关闭
        </div>
        <div id="mm-tabcloseother">
            除此之外全部关闭
        </div>
        <%--<div class="menu-sep"></div>
		<div id="mm-tabcloseright">当前页右侧全部关闭</div>
		<div id="mm-tabcloseleft">当前页左侧全部关闭</div>--%>
        <div class="menu-sep">
        </div>
        <div id="mm-exit">
            退出
        </div>
    </div>

</body>
</html>
